#include <iostream>
#include <unistd.h>
#include <signal.h>

using namespace std;

void handler(int signal)
{
    cout<<"将2号信号的方法重定义了"<<endl;
}
int main()
{
    signal(2,handler);
   
    cout<<"疯狂的进程:"<<getpid()<<endl;
    sleep(5);
    
    cout<<"111111111111111111"<<endl;
    sleep(5);
    cout<<"111111111111111111"<<endl;
    sleep(5);
    return 0;
}